<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>体侧记录</title>
    <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0.maximum-scale=1.0,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/bosscoach.css">
	<link rel="stylesheet" href="css/flexible.css">
	<link rel="stylesheet" href="css/vant.css">
	<script src="js/fontsize.js"></script>
	<script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/vue/vue.js"></script>
    <script src="js/vue/axios.js"></script>
    <script src="js/vue/vant.js"></script>
    <script src="js/glabe.js"></script>
    <script src="js/jquery.md5.js"></script>
	<script src="js/vue/qs.js"></script>
	<style>
		.container_box{
			font-size: 0.14rem;
		}
	</style>
</head>
<body> 
<div class="container_box" id="app">
    <template>
		<div class="tar_qh fk_content">
			<div class="content">
				<div class="addBtn" @click="addTest()">+添加体测记录</div>
				<div  class="list">
					<div class="body_details" v-for="(item,key) in dataList">
						<div class="ovfl body_side">
							<p class="lf">
								<span>记录时间：</span>
								<span class="color_body">{{item.Addtime}}</span>
							</p>
							<p class="rf">
								<span >记录人：</span>
								<span class="color_body">{{item.Sname}}</span>
							</p>
						</div>
						<div class="body_data margintop1">
							<p>
								<span>身高：</span>
								<span>{{item.height}}cm</span>
							</p>
							<p>
								<span>体重：</span>
								<span>{{item.weight}}kg</span>
							</p>
						</div>
						<div class="body_data">
							<p>
								<span>BMI：</span>
								<span>{{item.bmi}}KG/M2</span>
							</p>
							<p>
								<span>体脂：</span>
								<span>{{item.bodyfat}}%</span>
							</p>
						</div>
						<div v-if="item.active != 1">
							<div class="body_data">
								<p>
									<span>臀围：</span>
									<span>{{item.hipline}}cm</span>
								</p>
								<p>
									<span>胸围：</span>
									<span>{{item.bust}}cm</span>
								</p>
							</div>
							<div class="body_data">
								<p>
									<span>腰围：</span>
									<span>{{item.thewaist}}cm</span>
								</p>
								<p>
									<span>肩宽：</span>
									<span>{{item.shoulder}}cm</span>
								</p>
							</div>
							<div class="body_data">
									<p>
										<span>小腿围：</span>
										<span>{{item.minthigh}}cm</span>
									</p>
									<p>
										<span>大腿围：</span>
										<span>{{item.maxthigh}}cm</span>
									</p>
								</div>
							<div class="remarks">
								备注内容:
								<span>{{item.info}}</span>
							</div>
						</div>
						<div class="open_details" v-if="item.active == 1" @click="changeActive(0,key)">
							↓展开
						</div>
						<div class="open_details" v-else @click="changeActive(1,key)">
							↑收起
						</div>
					</div>
				</div>
			</div>
		</div>	
	</template>
</div>
<div class="technology">由馆家提供技术支持</div>
</body>
<script>
	var app = new Vue({
		el: '#app',
		data: {
			//会员id
			id:null,
			//列表
			dataList:null
		},
		created() {
			//获取路由参数
			let id = getUrlQueryString('id');
			this.id = id;
			//获取体测记录
			axios.get(`mobileapi/boss/user_bodytest.php?act=list&uid=${id}`).then(res=>{
				if(res.data.code == 200){
					console.log(res.data.data);
					// this.dataList = res.data.data;
					let list = res.data.data;
					list.forEach(item => {
						item.active = 1
					});
					this.dataList = list;
				}else{
					vant.Toast(res.data.msg);
				}
			}).catch(err=>{
				vant.Toast('请求发送失败，请重试');
			})
		},
		methods: {
			//添加体测按钮
			addTest(){
				location.href = `bodyRecording.html?id=${this.id}`;
			},
			//看展开关闭按钮
			changeActive(val,key){
				this.dataList[key].active = val;
			}
		},
	})
</script>
</html>